Column

Chart A

tmax_jan_july = select(ny_noaa_cleaned, id, year, month, tmax, tmin, prcp) %>%
  filter(month == "01" | month == "07") %>%
  mutate(month = factor(month, labels = c("Jan", "July"))) %>%
  group_by(id, year, month) %>% 
  summarize(mean_tmax = mean(tmax, na.rm = TRUE),
            mean_tmin = mean(tmin, na.rm = TRUE),
            mean_prcp = mean(prcp, na.rm = TRUE))
tmax_jan_july %>%
  mutate(text_label = str_c('Year: ', year, ' MaxTemp: ', mean_tmax, ' C')) %>%
  plot_ly(x = ~year, y = ~mean_tmax, type = "scatter", mode = "markers",
          alpha = 0.5,
          color = ~month,
          text = ~text_label)
## Warning: Ignoring 347 observations
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels

Column

Chart B

ny_noaa_cleaned %>%
  filter(year == 2000 | year == 2001|year == 2002| year == 2003| year == 2004| year == 2005| year == 2006| year == 2007| year == 2008| year == 2009| year == 2010) %>%
  filter(prcp < 10) %>%
  plot_ly(y = ~prcp, color = ~year, type = "box",
          colors = "Set2")

Chart C

ny_noaa_cleaned %>% 
  count(id) %>% 
  mutate(id = fct_reorder(id, n)) %>% 
  plot_ly(x = ~id, y = ~n, color = ~id, type = "bar")
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors

## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors